package com.hk.service.impl.kyc;

import java.util.List;

import org.springframework.stereotype.Service;

import com.hk.commons.Constant;
import com.hk.commons.HqlFilter;
import com.hk.commons.entity.HKNews;
import com.hk.dao.base.impl.BaseServiceImpl;
import com.hk.service.kyc.INews;



@Service
public class NewsImpl extends BaseServiceImpl<HKNews> implements INews {

	@Override
	public HKNews findById(Integer id) {
		HKNews result = null;
		if (id != null){
			result = getById(id);
		}
		return result;
	}

	@Override
	public Boolean add(HKNews model) {
		 
		model.setCts(System.currentTimeMillis());
		super.save(model);
		return true;
	}
	
	@Override
	public List<HKNews> getActiveNews(){
		HqlFilter hqlFilter = new HqlFilter();
		hqlFilter.addEQFilter("status", Constant.ACTIVITY_ACTIVE);
		List<HKNews> actList = findByFilter(hqlFilter);
		return actList;
	}
}
